import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)

export default new vuex.Store({
	state:{
		details:"",     
		code:"",        //这里是用来保存用户通过调用wx.login获取的code值
		userInfo:'',    //这个是用来保存用户的基本信息 
		discussType:'' ,
		dakaId:""    ,     //打卡文章id  
		commentId:"",   //被评论文章的ID
		du_id:'',        //用户id
		content:"",   //获取发表的内容
		comment:[],   //存放评论信息
		parse:"",     //答题答案解析
		shareImg:"",   //分享图
		information:{ // 用户的基本信息
			headImg:'',
			birthDate: '',
			index:0,
			returnId:"",
			nickname:"",
			weChatNumber:"",
			sign:""
		},
		myDaka:"",       //我的打卡信息   
		setTime:"",     
	},
	mutations:{
		setFooter(state,value){
          state.details=value;
		},
		setCode(state,value){
          state.code=value;
		},
		setuserInfo(state,value){
          state.userInfo=value;
		},
		setdiscussType(state,value){
          state.discussType=value;
		},
		setDakaId(state,value){
          state.dakaId=value;
		},
		setDuid(state,value){
          state.du_id=value;
		},
		setContent(state,value){
          state.content=value;
		},
		setCommentId(state,value){
          state.commentId=value;
		},
		setComment(state,value){
			state.comment=[];
          state.comment=value;
		},
		setParse(state,value){
          state.parse=value;
		},
		setShareImg(state,value){
          state.shareImg=value;
		},
		setInformation(state,value){
          state.information=value;
		},
		setmyDaka(state,value){
          state.myDaka=value;
		},
		setTime(state,value){
          state.setTime=value;
		}
	},
	actions:{
			setFooter(content,value){
	          content.commit('setFooter',value)
			},
		setCode(content,value){    
          content.commit('setCode',value)
		},
		setuserInfo(content,value){
          content.commit('setuserInfo',value)
		},
		setdiscussType(content,value){
          content.commit('setdiscussType',value)
		},
		setDakaId(content,value){
          content.commit('setDakaId',value)
		},
		setDuid(content,value){
           content.commit('setDuid',value)
		},
		setContent(content,value){
           content.commit('setContent',value)
		},
		setCommentId(content,value){
           content.commit('setCommentId',value)
		},
		setComment(content,value){
           content.commit('setComment',value)
		},
		setParse(content,value){
           content.commit('setParse',value)
		},
		setShareImg(content,value){
           content.commit('setShareImg',value)
		},
		setInformation(content,value){
           content.commit('setInformation',value)
		},
		setmyDaka(content,value){
           content.commit('setmyDaka',value)
		},
		setTime(content,value){
           content.commit('setTime',value)
		}
	}
})